package x.trident.core.util;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.extern.slf4j.Slf4j;

/**
 * wuqiangfu special annotation
 *
 * @Package:        com.maas.platform.common.utils
 * @FileName:       NumberUtils.java
 * @ClassName:      NumberUtils
 * @Description:    分布式id生成器
 * @Author:         zza
 * @CreateDate:     2022/5/10 17:38
 * @UpdateUser:     wuqiangfu
 * @UpdateDate:     2022/5/10 17:38
 * @UpdateRemark:   说明本次修改内容
 * @Version:        v1.0
 */
@Slf4j
public class NumberUtils {

   /**
    *  生成分布式id
    *
    */
   public static Long generator() {
      return IdWorker.getId();
   }

   /**
    *  生成分布式id
    *
    */
   public static String generatorString() {
      return generator().toString();
   }

   public static Integer generator32Int() {
      return Integer.parseInt(IdWorker.get32UUID());
   }
}
